package com.cqc.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.task.TaskExecutor;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.web.servlet.config.annotation.AsyncSupportConfigurer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;

/**
 * @author cui
 * @date 2025/3/22 13:39
 * @description  演示 CallableController
 **/

@Configuration
public class AppWebMvcConfigurer implements WebMvcConfigurer {


    @Resource(name = "asyncTask")
    ThreadPoolTaskExecutor taskExecutor;

    @Override
    public void configureAsyncSupport(AsyncSupportConfigurer configurer) {
        configurer.setTaskExecutor(taskExecutor);
        WebMvcConfigurer.super.configureAsyncSupport(configurer);
    }
}
